import { h, init } from 'snabbdom'
import style from 'snabbdom/modules/style'
import eventlisteners from 'snabbdom/modules/eventlisteners'

let patch = init([])

let data=[
    {
        move_name:'冷血狂宴',
        time:'2020/12/04',
        type:"科幻/奇幻"
    },
    {
        move_name:'赤狐书生',
        time:'2020/12/04',
        type:"奇幻/剧情 "
    }, 
     {
        move_name:'沐浴之王',
        time:'2020/12/11',
        type:"喜剧"
    },
    {
        move_name:'日不落酒店',
        time:'2020/12/12',
        type:"喜剧/科幻"
    },
    {
        move_name:'阿凡达2',
        time:'2020/12/18',
        type:"动作/科幻/冒险/史诗"
    }
]

let vnode = h('div.ui-timeLine', getChild(data))

let app = document.querySelector('#app')


function btnInit(){
    h('a.btn',{
        on: { click: [addMove, '排序'] }
    },'新增')
}
function getChild(data){
   var arr=[];
    data.forEach(e => {
         arr.push(
                h('a.item',
                    h('div.box',
                        h('div.cbox',
                            [
                                h('div.date',e.time),
                                h('div.title',e.move_name)
                            ]
                        )
                    )
                )
             )
        })
   return arr
}

function changeSort(){


}
let oldVnode = patch(app, vnode)


